package com.shuzijun.leetcode.editor.cn;
public class SortedMergeLcci{
    public static void main(String[] args) {
         Solution solution = new SortedMergeLcci().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public void merge(int[] A, int m, int[] B, int n) {
        int k = m+n-1;
        int i = m-1;
        int j = n-1;
        while (i >= 0 && j >= 0){
            if (A[i] >= B[j]){
                A[k--] = A[i];
                i--;
            }else {
                A[k--] = B[j];
                j--;
            }
        }

        while (i >= 0){
            A[k--] = A[i--];
        }

        while (j >= 0){
            A[k--] = B[j--];
        }
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}